Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix php-fpm PID check for php8.1 #347

Merged
merged 6 commits into from
Sep 28, 2023
Merged

Fix php-fpm PID check for php8.1 #347

merged 6 commits into from
Sep 28, 2023

Conversation

joecorall
Copy link
Contributor

@joecorall joecorall commented Jun 16, 2023

Summary

make drupal-database during make starter TAG=2.0.0 hangs while waiting to find the php-fpm PID file, which is in a new location on php 8.1. This PR updates the check to work for php 8.1, and updates the buildkit and starter site tags to use php 8.1 and drupal 10.

How to test

First, #346 needs to merge and this branch needs rebased.

Checkout this PR

cd /path/to/your/isle-dev/copy
gh pr checkout 347 --repo Islandora-Devops/isle-dc

Make sure php 8.1 + drupal 10 comes up

make starter
curl -v https://islandora.traefik.me/ > /dev/null

@joecorall joecorall marked this pull request as ready for review June 16, 2023 16:22
@joecorall joecorall marked this pull request as draft June 21, 2023 19:11
@joecorall
Copy link
Contributor Author

Moving to draft until #346 merges this can't be tested.

@DonRichards
Copy link
Member

I have both PRs on my local machine. I can run make local without a problem but neither of the make starter TAG=xxx commands.

@joecorall joecorall marked this pull request as ready for review September 13, 2023 19:00
@DonRichards
Copy link
Member

Testing this required a change to the sample.env#L52 file. This pr isn't pulling in recent changes like those to the sample.env file. If I manually modify CODEBASE_PACKAGE=islandora/islandora-starter-site:dev-main to current CODEBASE_PACKAGE=islandora/islandora-starter-site:0.8.0 the 2nd command (make starter TAG=2.0.0) works as expected. But the first doesn't and probably won't because of the composer.lock file in starter.

@DonRichards DonRichards self-requested a review September 15, 2023 20:18
@joecorall
Copy link
Contributor Author

joecorall commented Sep 20, 2023

@DonRichards - did you have the latest commits of this branch checked out? I merged master into this branch before publishing the PR and this branch has v0.8.0 set for starter site

FWIW I only can get

make starter TAG=2.0.1 CODEBASE_PACKAGE=islandora/islandora-starter-site:1.1.0

to work properly. The 2.0.1 tag for the docker images has the drush path set correctly for drush 12. So I updated both those env vars in this PR. So now this PR should only need make starter to get php 8.1 + drupal 10 running.

@joecorall
Copy link
Contributor Author

While make starter completes successfully with this PR, the built site isn't quite fully configured due to some drush commands that broke with drush 12.

I created an isle-buildkit PR will need merged before this PR can merge: Islandora-Devops/isle-buildkit#289

After Islandora-Devops/isle-buildkit#289 merges, we can set the tag (probably 2.0.2) in this PR

@kayakr
Copy link

kayakr commented Sep 22, 2023

@joecorall I see Islandora-Devops/isle-buildkit#289 has been merged.

I tried making the changes in this PR then
make starter TAG=2.0.1 CODEBASE_PACKAGE=islandora/islandora-starter-site:1.1.0

The make process got a fair way but then errored:

 [success] Installation complete.
docker compose exec -T drupal with-contenv bash -lc "drush -l https://islandora.traefik.me user:role:add fedoraadmin admin"
In EntityTypeManager.php line 139:                     
  The "features_bundle" entity type does not exist.  
make[1]: *** [starter-finalize] Error 1
make: *** [starter] Error 2

docker compose exec -T drupal with-contenv bash -lc "drush -l https://islandora.traefik.me ws"
gives

In EntityTypeManager.php line 139:
  The "features_bundle" entity type does not exist.  

as does drush cr etc.

@kayakr
Copy link

kayakr commented Sep 22, 2023

make demo TAG=2.0.1 breaks early with:

✔ Container isle-dc-fcrepo-1           Started                                                                                                                                                            
✔ Container isle-dc-drupal-1           Started                                                                                                                                                                  
docker compose exec -T drupal with-contenv bash -lc 'composer install; chown -R nginx:nginx .'
s6-envdir: fatal: unable to envdir: No such file or directory
make[1]: *** [local] Error 111
make: *** [demo] Error 2

@kayakr
Copy link

kayakr commented Sep 22, 2023

make local dies at the same point.

@joecorall
Copy link
Contributor Author

@kayakr did you run make down clean first? I am wondering if you had an existing codebase in your isle-dc directory? Or was this error with a fresh clone of this repo/PR

@joecorall
Copy link
Contributor Author

@kayakr @DonRichards OK now that Islandora-Devops/isle-buildkit#289 has merged and a tag was made, if you pull down the changes from this PR running

git pull origin php-81-fpm-pid
make down clean
make starter

Should get you a local d10 site running with the latest starter site install.

@joecorall
Copy link
Contributor Author

To get solr working, we also need this PR to merge Islandora-Devops/isle-buildkit#290

@aOelschlager
Copy link
Contributor

I'm able to run this with starter_dev and it works, but with a few changes. I set the tag to main instead of 2.0.2 because the pr mentioned above has been merged.

@kayakr I did run into the same issue:
docker compose exec -T drupal with-contenv bash -lc 'composer install; chown -R nginx:nginx .'
s6-envdir: fatal: unable to envdir: No such file or directory

To fix that error I ran this command
docker compose exec -T drupal with-contenv bash -lc "chown -R nginx:nginx . ; su nginx -s /bin/bash -c 'composer install'"

Which is from this pr from @DonRichards (although it was not able to run in the Makefile itself, I had to use the command line.)

Then I ran make starter-finalize ENVIRONMENT=starter_dev

This gave me a Drupal 10.1.2 site running PHP 8.1.22

@joecorall
Copy link
Contributor Author

This PR now uses islebuildkit:2.0.3 which should fix the solr issues.

@DonRichards
Copy link
Member

I was able to get this but only after pulling in the code @aOelschlager mentioned

Which is from this pr from @DonRichards (although it was not able to run in the Makefile itself, I had to use the command line.)

@DonRichards
Copy link
Member

DonRichards commented Sep 27, 2023

tested make starter and it worked as expected.

curl -v https://islandora.traefik.me/ > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 127.0.0.1:443...
* Connected to islandora.traefik.me (127.0.0.1) port 443 (#0)
* ALPN: offers h2,http/1.1
* (304) (OUT), TLS handshake, Client hello (1):
} [325 bytes data]
*  CAfile: /etc/ssl/cert.pem
*  CApath: none
* (304) (IN), TLS handshake, Server hello (2):
{ [122 bytes data]
* (304) (IN), TLS handshake, Unknown (8):
{ [15 bytes data]
* (304) (IN), TLS handshake, Certificate (11):
{ [3975 bytes data]
* (304) (IN), TLS handshake, CERT verify (15):
{ [264 bytes data]
* (304) (IN), TLS handshake, Finished (20):
{ [36 bytes data]
* (304) (OUT), TLS handshake, Finished (20):
} [36 bytes data]
* SSL connection using TLSv1.3 / AEAD-CHACHA20-POLY1305-SHA256
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=traefik.me
*  start date: Sep 18 13:06:49 2023 GMT
*  expire date: Dec 17 13:06:48 2023 GMT
*  subjectAltName: host "islandora.traefik.me" matched cert's "*.traefik.me"
*  issuer: C=US; O=Let's Encrypt; CN=R3
*  SSL certificate verify ok.
* using HTTP/2
* h2 [:method: GET]
* h2 [:scheme: https]
* h2 [:authority: islandora.traefik.me]
* h2 [:path: /]
* h2 [user-agent: curl/8.1.2]
* h2 [accept: */*]
* Using Stream ID: 1 (easy handle 0x15200a800)
> GET / HTTP/2
> Host: islandora.traefik.me
> User-Agent: curl/8.1.2
> Accept: */*
>
  0     0    0     0    0     0      0      0 --:--:--  0:00:29 --:--:--     0< HTTP/2 504
< content-type: text/plain; charset=utf-8
< content-length: 15
< date: Wed, 27 Sep 2023 22:02:43 GMT
<
{ [15 bytes data]
100    15    0    15    0     0      0      0 --:--:--  0:00:30 --:--:--     4
* Connection #0 to host islandora.traefik.me left intact

@joecorall
Copy link
Contributor Author

:shipit:

@DonRichards
Copy link
Member

make starter TAG=2.0.1 CODEBASE_PACKAGE=islandora/islandora-starter-site:1.1.0 works as well!

@DonRichards DonRichards merged commit 2bcd55f into Islandora-Devops:development Sep 28, 2023
@DonRichards
Copy link
Member

Thanks @joecorall

@joecorall joecorall deleted the php-81-fpm-pid branch September 28, 2023 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants